import ShaderLib from "../ShaderLib";

export default class CircleScanShader {
    public static getVertexShader() {
        return ShaderLib.getDefaultVertexShader();
    }

    public static getFragmentShader() {
        let shader = `
            #include <common>
		    #include <fog_pars_fragment>
		    #include <logdepthbuf_pars_fragment>
            varying vec2 uvTexcoord;
            uniform float time;
            uniform vec3 v_color;
            uniform float radius;
            uniform float bandwidth;
      
            void main(){       
                vec2 uv = uvTexcoord;
                float l = pow(uv.x - 0.5, 2.)+pow(uv.y - 0.5, 2.);

                if ( l > time * time || l < time * time - bandwidth) {
                    discard;
                }    

                gl_FragColor= vec4(v_color, 1);
                #include <fog_fragment>
            }
        `;
        return shader;
    }

}
